package com.jie.netty.listener;

import com.jie.constant.IMRabbitMqKey;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

import java.io.IOException;

/**
 * @Author: 杰
 * @Project :netty-communication
 * @Description: 群聊信息监听器
 * @DateTime: 2023/11/18 13:26
 **/

@Slf4j
@Component
public class GroupMessageListener {
    private final RabbitTemplate rabbitTemplate;
    private final RedisTemplate redisTemplate;

    public GroupMessageListener(RabbitTemplate rabbitTemplate, RedisTemplate redisTemplate) {
        this.rabbitTemplate = rabbitTemplate;
        this.redisTemplate = redisTemplate;
    }

    /**
     * 群聊处理
     * @param messages
     * @param channel
     * @throws IOException
     */
    @RabbitListener(queues = IMRabbitMqKey.IM_RESULT_GROUP_QUEUE)
    public void processGroupChatMessages(Message messages, Channel channel) throws IOException {

    }
}
